package com.sunshine.simplehospital.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentStatePagerAdapter
import com.sunshine.simplehospital.ui.fragment.GotoFragment
import com.sunshine.simplehospital.ui.fragment.MeFragment
import com.sunshine.simplehospital.ui.fragment.RecordFragment
import com.sunshine.simplehospital.ui.fragment.RegisterFragment

/**
 * Created by sunshine on 2020/4/29
 */
class MainAdapter(fm: FragmentManager) : FragmentStatePagerAdapter(fm) {

    private val fragmentList: List<Fragment> = listOf(
        RegisterFragment(),
        GotoFragment(),
        RecordFragment(),
        MeFragment()
    )
    override fun getItem(position: Int): Fragment {
        return fragmentList[position]
    }

    override fun getCount(): Int {
        return fragmentList.size
    }
}